module Epic
	module Command
		class Gettime < Blather::Stanza::Iq::Command

			def self.create
				node = self.new
				node.node = 'gettime'
				node
			end

			def reply!
				super

				field = Blather::XMPPNode::Field.create(:type => :fixed, :label => 'current time', :var => 'ctime')
				field.value = Time.now.to_s

				f = Blather::XMPPNode::Form.new
				f.type = :result
				f << field
				## Andw why can i use command here?
				command << f
				## Why do i have to use self??
				self.status = :completed
				self
			end
		end
	end
end
